package pub.tbc.delay;

import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;

/**
 * @author tbc on 2017/8/9 10:14:25.
 */
@Slf4j
public class ThreadPool {
    private static int CPUs = Runtime.getRuntime().availableProcessors();
    private static ScheduledExecutorService scheduledExecutor = Executors.newScheduledThreadPool(CPUs * 2);
    private static ExecutorService executorService = Executors.newFixedThreadPool(CPUs * 2);

    public static ScheduledExecutorService getScheduledExecutor() {
        return scheduledExecutor;
    }

    public static ExecutorService getExecutorService() {
        return executorService;
    }

}
